
****************************************
***ANALYSIS FOR FIGURE 4 AND TABLE 3****
***AND GENDER ANALYSIS OF***************
***CORRESPONDENCE STUDY IN APPENDIX*****
****************************************

**NOTE: These figures were run in Stata 15**

ssc install blindschemes //installing plotplain
set scheme plotplain //setting color and design

cd "" //set directory
use ReplicationDataFigure4Table3.dta, clear



**Figure 4 (Responsiveness by Ideology)
graph set window fontface "Times New Roman"
reg responded i.moderatetreat
margins moderatetreat, asbalanced level(85) post
est store Fig4HVersion
coefplot Fig4HVersion,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.moderatetreat="Ideologue" 1.moderatetreat="Moderate")  drop (_cons) vertical ytitle ("Response Rate") title("All", size(medlarge))
graph save Fig4HVersion, replace
reg responded i.moderatetreat if democrat==1
margins moderatetreat, asbalanced level(85) post
est store Fig4HVersionDems
coefplot Fig4HVersionDems,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.moderatetreat="Progressive" 1.moderatetreat="Moderate")  drop (_cons) vertical title("Democrats", size(medlarge))
graph save Fig4HVersionDems, replace
reg responded i.moderatetreat if democrat==0
margins moderatetreat, asbalanced level(85) post
est store Fig4HVersionReps
coefplot Fig4HVersionReps,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.moderatetreat="Conservative" 1.moderatetreat="Moderate") drop (_cons) vertical title("Republicans", size(medlarge))
graph save Figure4HVersionReps, replace

graph combine Fig4HVersion.gph Fig4HVersionDems.gph Figure4HVersionReps.gph, r(1) title("Response to Volunteer Inquiries", size(medlarge))
graph save Figure4HVersionFull, replace

**Table 3

reg responded i.moderatetreat
	outreg2 using ModerateRespond, e(rmse r2) 2aster dec(2) label excel replace
reg responded i.moderatetreat##c.abstweetscorepluserror
	outreg2 using ModerateRespond, e(rmse r2) 2aster dec(2) label excel 
reg responded i.moderatetreat##c.abstweetscorepluserror if democrat==1
	outreg2 using ModerateRespond, e(rmse r2) 2aster dec(2) label excel 
reg responded i.moderatetreat##c.abstweetscorepluserror if democrat==0
	outreg2 using ModerateRespond, e(rmse r2) 2aster dec(2) label excel 



**Appendix--Gender Effects**
reg responded i.femaleVol
margins femaleVol, asbalanced level(95) post
est store FigFemVolVersion
coefplot FigFemVolVersion,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.femaleVol="Male" 1.femaleVol="Female")  drop (_cons) vertical ytitle ("Response Rate") title("All", size(medlarge))
graph save FigFemVolVersion, replace
reg responded i.femaleVol if democrat==1
margins femaleVol, asbalanced level(85) post
est store FigFemVolVersionDems
coefplot FigFemVolVersionDems,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.femaleVol="Male" 1.femaleVol="Female")  drop (_cons) vertical ytitle ("Response Rate") title("Democrats", size(medlarge))
graph save FigFemVolVersionDems, replace
reg responded i.femaleVol if democrat==0
margins femaleVol, asbalanced level(85) post
est store FigFemVolVersionReps
coefplot FigFemVolVersionReps,  levels (95)  msymbol(smdiamond) ciopts(lwidth(medium thick) recast(rcap rspike)) yscale(range(0(.05).4)) ylabel(0(.05).4, format(%03.2f)) rename(0.femaleVol="Male" 1.femaleVol="Female")  drop (_cons) vertical ytitle ("Response Rate") title("Republicans", size(medlarge))
graph save FigFemVolVersionReps, replace


graph combine FigFemVolVersion.gph FigFemVolVersionDems.gph FigFemVolVersionReps.gph, r(1) title("Response to Volunteer Inquiries", size(medlarge))
graph save FigFemVolVersionFull, replace
